R Markdown

This is an R Markdown document. Markdown is a simple formatting syntax for authoring HTML, PDF, and MS Word documents. For more details on using R Markdown see http://rmarkdown.rstudio.com.

When you click the Knit button a document will be generated that includes both content as well as the output of any embedded R code chunks within the document. You can embed an R code chunk like this:

# list.of.packages <- c("readxl", "tidyverse", "DT", "leaflet", "palmerpenguins")  # List the needed packages
# new.packages <- list.of.packages[!(list.of.packages %in% installed.packages()[, "Package"])]  # Of the needed packages, list those  not already installed
# if(length(new.packages)) install.packages(new.packages) # Install any packages not already installed
# for (k in 1:length(list.of.packages)) {
#   library(list.of.packages[k], character.only = TRUE)  # Load the needed packages using library
# }
# rm(list = c("k","list.of.packages","new.packages"))
library(tidyverse)
## Warning: package 'tidyverse' was built under R version 4.3.2
## Warning: package 'ggplot2' was built under R version 4.3.2
## Warning: package 'tibble' was built under R version 4.3.2
## Warning: package 'tidyr' was built under R version 4.3.2
## Warning: package 'readr' was built under R version 4.3.2
## Warning: package 'purrr' was built under R version 4.3.2
## Warning: package 'dplyr' was built under R version 4.3.2
## Warning: package 'stringr' was built under R version 4.3.2
## Warning: package 'forcats' was built under R version 4.3.2
## Warning: package 'lubridate' was built under R version 4.3.2
## ── Attaching core tidyverse packages ──────────────────────── tidyverse 2.0.0 ──
## ✔ dplyr     1.1.4     ✔ readr     2.1.4
## ✔ forcats   1.0.0     ✔ stringr   1.5.1
## ✔ ggplot2   3.4.4     ✔ tibble    3.2.1
## ✔ lubridate 1.9.3     ✔ tidyr     1.3.0
## ✔ purrr     1.0.2     
## ── Conflicts ────────────────────────────────────────── tidyverse_conflicts() ──
## ✖ dplyr::filter() masks stats::filter()
## ✖ dplyr::lag()    masks stats::lag()
## ℹ Use the conflicted package (<http://conflicted.r-lib.org/>) to force all conflicts to become errors
library(DT)
## Warning: package 'DT' was built under R version 4.3.2
library(plotly)
## Warning: package 'plotly' was built under R version 4.3.2
## 
## Attaching package: 'plotly'
## 
## The following object is masked from 'package:ggplot2':
## 
##     last_plot
## 
## The following object is masked from 'package:stats':
## 
##     filter
## 
## The following object is masked from 'package:graphics':
## 
##     layout
library(palmerpenguins)
## Warning: package 'palmerpenguins' was built under R version 4.3.2
penguins |> summarise(.by = species, across(where(is.numeric), mean)) |>  DT::datatable(
                extensions ='Buttons',
                options =list(dom ='Blfrtip',
                               buttons =c('copy', 'csv', 'excel', 'pdf'),
                               lengthMenu =list(c(10,25,50,-1),
                                                 c(10,25,50,"All"))))
heavy_penguin <-penguins$body_mass_g |> sort.default() |> max()

The heaviest penguin measured weighed 6300